package com.example.yian.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;

@TableName("users")
@Data // Generates getters, setters, toString, equals, and hashCode methods.
@AllArgsConstructor // Generates a constructor with all arguments.
@NoArgsConstructor // Generates a no-argument constructor.
public class User {
    @TableId(value = "user_id", type = IdType.AUTO)
    private Long userId;

    private String openid;

    @TableField("session_key")
    private String sessionKey;

    private String token;

    @TableField("token_expiration")
    private Timestamp tokenExpiration;

    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private Timestamp createdAt;

    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private Timestamp updatedAt;
}
